﻿using System.Collections.Generic;
using Baik.Interface.Framework;

namespace Baik.Interface
{
    public class Que<T> : IQue<T>
    {
        public Que()
        {
            List = new List<T>();
        }

        private List<T> List { get; set; }

        public void Push(T itm)
        {
            List.Add(itm);
        }

        public void Push(IEnumerable<T> items)
        {
            List.AddRange(items);
        }

        
        public T Last
        {
            get { return List[0]; }
        }
        public T Pop()
        {
            var rtn = Peek();
            List.RemoveAt(0);
            return rtn;
        }

        public T Peek()
        {
            return Last;
        }

        public bool Empty {
            get {return  List.Count < 1; }
        }

        public void Clear()
        {
            List.Clear();
        }
    }
}
